<template>
  <BasicModal
    v-bind="$attrs"
    @register="registerModal"
    :title="title"
    width="80%"
    :minHeight="600"
    :showContinueBtn="showContinueBtn"
    :continueText="continueText"
    cancelText="取消"
    :okText="title == '审核' ? '通过' : '确定'"
    @ok="handleSubmit(0)"
    @continue="handleSubmit(1)"
    :closeFunc="onClose">
    <template #insertFooter>
      <a-space :size="10" v-if="dataForm.id" class="float-left">
        <a-button :disabled="getPrevDisabled" @click="handlePrev">上一条</a-button>
        <a-button :disabled="getNextDisabled" @click="handleNext">下一条</a-button>
      </a-space>
      <a-space :size="10" v-if="title != '详情'" class="float-left">
        <a-button @click="temporaryStorage" style="margin-right: 10px">暂存</a-button>
      </a-space>
    </template>
    <a-row class="dynamic-form">
      <a-form
        :colon="false"
        size="default"
        layout="horizontal"
        labelAlign="right"
        :labelCol="{ style: { width: '100px' } }"
        :model="dataForm"
        :rules="dataRule"
        ref="formRef">
        <a-row :gutter="15">
          <a-col :span="8" class="ant-col-item" v-if="mainStatus == '7' || title == '归档'" style="margin-top: 10px">
            <a-form-item :labelCol="{ style: { width: '70px' } }" name="archiveNumber">
              <template #label>项目编号</template>
              <JnpfInput
                v-model:value="dataForm.archiveNumber"
                :disabled="mainStatus == '7'"
                @change="changeData('archiveNumber', -1)"
                placeholder="请输入"
                :allowClear="true"
                :style="{ width: '100%' }">
              </JnpfInput>
            </a-form-item>
          </a-col>
          <a-col :span="24" class="ant-col-item">
            <a-tabs v-model:activeKey="activecnbnut" tabPosition="top" class="mb-20">
              <a-tab-pane tab="招标方案内容" key="1" forceRender> </a-tab-pane>
              <a-tab-pane tab="招标结果内容" key="2" forceRender v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2"> </a-tab-pane>
            </a-tabs>
          </a-col>
          <div style="display: flex; flex-wrap: wrap" v-if="activecnbnut == '1'">
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="managementStyle">
                <template #label>管理方式</template>
                <JnpfRadio
                  v-model:value="dataForm.managementStyle"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : title == '编辑'
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('managementStyle', -1)"
                  :style="{ width: '100%' }"
                  size="default"
                  :options="optionsObj.managementStyleOptions"
                  :fieldNames="optionsObj.managementStyleProps"
                  direction="horizontal"
                  optionType="default">
                </JnpfRadio>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="reportingCorp">
                <template #label>上报单位(部门)</template>
                <JnpfInput
                  v-model:value="dataForm.reportingCorp"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('reportingCorp', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="tenderingEntity">
                <template #label>招标主体</template>
                <JnpfInput
                  v-model:value="dataForm.tenderingEntity"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('tenderingEntity', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="16" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="projectName">
                <template #label>项目名称</template>
                <JnpfInput
                  v-model:value="dataForm.projectName"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('projectName', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="itemClassification">
                <template #label>招标事项分类</template>
                <JnpfSelect
                  v-model:value="dataForm.itemClassification"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('itemClassification', -1)"
                  :style="{ width: '100%' }"
                  size="default"
                  :allowClear="true"
                  :options="optionsObj.itemClassificationOptions"
                  :fieldNames="optionsObj.itemClassificationProps"
                  direction="horizontal"
                  optionType="default">
                </JnpfSelect>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="controlPrice">
                <template #label>招标控制价</template>
                <JnpfInputNumber
                  v-model:value="dataForm.controlPrice"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('controlPrice', -1)"
                  placeholder="请输入"
                  addonAfter="万元"
                  :style="{ width: '100%' }"
                  :step="1"
                  :controls="false">
                </JnpfInputNumber>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="organizationalForm">
                <template #label>招标组织形式</template>
                <JnpfSelect
                  v-model:value="dataForm.organizationalForm"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('organizationalForm', -1)"
                  :style="{ width: '100%' }"
                  size="default"
                  :allowClear="true"
                  :options="optionsObj.organizationalFormOptions"
                  :fieldNames="optionsObj.organizationalFormProps"
                  direction="horizontal"
                  optionType="default">
                </JnpfSelect>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="biddingMethod">
                <template #label>招标方式</template>
                <JnpfSelect
                  v-model:value="dataForm.biddingMethod"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('biddingMethod', -1)"
                  :style="{ width: '100%' }"
                  size="default"
                  :allowClear="true"
                  :options="optionsObj.biddingMethodOptions"
                  :fieldNames="optionsObj.biddingMethodProps"
                  direction="horizontal"
                  optionType="default">
                </JnpfSelect>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="agencyOne">
                <template #label>代理机构</template>
                <JnpfSelect
                  v-model:value="dataForm.agencyOne"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('agencyOne', -1)"
                  placeholder="请选择"
                  :allowClear="true"
                  :style="{ width: '100%' }"
                  :showSearch="false"
                  :options="optionsObj.agencyOneOptions"
                  :fieldNames="optionsObj.agencyOneProps">
                </JnpfSelect>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="scoringMethodOne">
                <template #label>评分方法</template>
                <JnpfRadio
                  v-model:value="dataForm.scoringMethodOne"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('scoringMethodOne', -1)"
                  :style="{ width: '100%' }"
                  size="default"
                  :options="optionsObj.scoringMethodOneOptions"
                  :fieldNames="optionsObj.scoringMethodOneProps"
                  direction="horizontal"
                  optionType="default">
                </JnpfRadio>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item" v-if="dataForm.scoringMethodOne == 2">
              <a-form-item name="scoringMethodTwo">
                <template #label>其他(评分说明)</template>
                <JnpfInput
                  v-model:value="dataForm.scoringMethodTwo"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('scoringMethodTwo', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="scoringIndicatorSettingsOne">
                <template #label>评分指标设置</template>
                <JnpfInput
                  v-model:value="dataForm.scoringIndicatorSettingsOne"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('scoringIndicatorSettingsOne', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
                <span class="tips">可根据实际情况自行修改</span>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="evalSetting">
                <template #label>评标专家设置</template>
                <JnpfInput
                  v-model:value="dataForm.evalSetting"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('evalSetting', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="settingOwinningBidderOne">
                <template #label>中标人设置</template>
                <JnpfTextarea
                  v-model:value="dataForm.settingOwinningBidderOne"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('settingOwinningBidderOne', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }"
                  :autoSize="{ minRows: 2, maxRows: 4 }">
                </JnpfTextarea>
                <span class="tips">可根据实际情况自行修改</span>
              </a-form-item>
            </a-col>
            <a-col :span="12" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="contractPeriod">
                <template #label>合同期</template>
                <JnpfInputNumber
                  v-model:value="dataForm.contractPeriod"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('contractPeriod', -1)"
                  placeholder="请输入"
                  addonAfter="年"
                  :step="1"
                  :style="{ width: '100%' }">
                </JnpfInputNumber>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="annexProgrammeDocument">
                <template #label>方案上报文件名称</template>
                <JnpfUploadFile
                  v-model:value="dataForm.annexProgrammeDocument"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('annexProgrammeDocument', -1)"
                  :fileSize="10"
                  sizeUnit="MB"
                  :limit="9"
                  pathType="defaultPath"
                  :isAccount="0"
                  buttonText="点击上传"
                  tipText="上报文件PDF（文件名+文号）；单文件上传大小最大10MB">
                </JnpfUploadFile>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="biddingDocumentId">
                <template #label>招标文件及附件</template>
                <JnpfUploadFile
                  v-model:value="dataForm.biddingDocumentId"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : schemeTable
                      ? true
                      : false
                  "
                  @change="changeData('biddingDocumentId', -1)"
                  :fileSize="10"
                  sizeUnit="MB"
                  :limit="9"
                  pathType="defaultPath"
                  :isAccount="0"
                  buttonText="点击上传"
                  tipText="招标主体招标文件及相关附件（上传PDF版）；单文件上传大小最大10MB">
                </JnpfUploadFile>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="decisionProcedure">
                <template #label>审批/备案决策程序</template>
                <JnpfCheckbox
                  v-model:value="dataForm.decisionProcedure"
                  :disabled="
                    isSubNum == '1'
                      ? true
                      : title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && !dataForm.isApproval
                      ? false
                      : !dataForm.isApproval && isSub
                      ? true
                      : title == '编辑' && dataForm.isApproval
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? true
                      : false
                  "
                  @change="changeData('decisionProcedure', -1)"
                  :style="{ width: '100%' }"
                  :options="optionsObj.decisionProcedureOptions"
                  :fieldNames="optionsObj.decisionProcedureProps"
                  direction="horizontal">
                </JnpfCheckbox>
              </a-form-item>
            </a-col>
            <!-- 二级审批/备案批准文件 -->
            <div v-if="isSubNum == '2'">
              <a-col :span="24" class="ant-col-item" v-if="mainStatus == '1' ? true : mainStatus == '2' ? true : true">
                <a-form-item :labelCol="{ style: { width: '170px' } }">
                  <template #label>子公司审批/备案批准文件</template>
                  <JnpfUploadFile
                    v-model:value="dataForm.approvalDocumentsId"
                    :disabled="
                      mainStatus == '1' && title == '详情'
                        ? true
                        : mainStatus == '2'
                        ? true
                        : mainStatus == '1' && peopleStatus == '3' && title == '审核' && dataForm.isApproval
                        ? false
                        : mainStatus == '1' && peopleStatus == '3' && title == '审核' && !dataForm.isApproval
                        ? false
                        : mainStatus == '1' && peopleStatus == '3' && title != '审核'
                        ? false
                        : true
                    "
                    @change="changeData('approvalDocumentsId', -1)"
                    :fileSize="10"
                    sizeUnit="MB"
                    :limit="9"
                    pathType="defaultPath"
                    :isAccount="0"
                    buttonText="点击上传"
                    tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）">
                  </JnpfUploadFile>
                </a-form-item>
              </a-col>
              <a-col
                :span="24"
                class="ant-col-item"
                v-if="
                  mainStatus == '1' && !dataForm.isApproval
                    ? false
                    : mainStatus == '1' && peopleStatus == '3'
                    ? true
                    : mainStatus == '2'
                    ? false
                    : mainStatus == '5' && peopleStatus == '3'
                    ? true
                    : mainStatus == '7' && peopleStatus == '3'
                    ? true
                    : mainStatus == '3' && peopleStatus == '3'
                    ? true
                    : false
                ">
                <a-form-item :labelCol="{ style: { width: '170px' } }" name="approvalDocumentsIdJt">
                  <template #label>集团审批/备案批准文件</template>
                  <JnpfUploadFile
                    v-model:value="dataForm.approvalDocumentsIdJt"
                    :disabled="mainStatus == '6' && title == '详情' ? true : true"
                    @change="changeData('approvalDocumentsIdJt', -1)"
                    :fileSize="10"
                    sizeUnit="MB"
                    :limit="9"
                    pathType="defaultPath"
                    :isAccount="0"
                    buttonText="点击上传"
                    tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）">
                  </JnpfUploadFile>
                </a-form-item>
              </a-col>
            </div>
            <!-- 一级审批/备案批准文件 -->
            <div v-if="isSubNum == '1'">
              <a-col :span="24" class="ant-col-item" v-if="mainStatus == '2' ? true : mainStatus == '6' ? true : mainStatus == '5' ? true : true">
                <a-form-item
                  :labelCol="{ style: { width: '170px' } }"
                  v-if="
                    peopleStatus == '1' && mainStatus == '7'
                      ? false
                      : peopleStatus == '1' && mainStatus == '5'
                      ? false
                      : peopleStatus == '2' && mainStatus == '2'
                      ? true
                      : peopleStatus == '2' && mainStatus == '6' && !dataForm.isApproval
                      ? false
                      : peopleStatus == '1' && mainStatus == '2'
                      ? false
                      : peopleStatus == '1' && mainStatus == '6'
                      ? false
                      : peopleStatus == '1' && mainStatus == '3'
                      ? false
                      : true
                  ">
                  <template #label>子公司审批/备案批准文件</template>
                  <JnpfUploadFile
                    v-model:value="dataForm.approvalDocumentsId"
                    :disabled="mainStatus == '2' ? true : mainStatus == '6' ? true : mainStatus == '5' ? true : true"
                    @change="changeData('approvalDocumentsId', -1)"
                    :fileSize="10"
                    sizeUnit="MB"
                    :limit="9"
                    pathType="defaultPath"
                    :isAccount="0"
                    buttonText="点击上传"
                    tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）">
                  </JnpfUploadFile>
                </a-form-item>
              </a-col>
              <a-col
                :span="24"
                class="ant-col-item"
                v-if="
                  peopleStatus == '1' && mainStatus == '7' && title == '详情'
                    ? true
                    : peopleStatus == '2' && mainStatus == '7' && title == '详情'
                    ? true
                    : mainStatus == '2' && title == '审核'
                    ? true
                    : mainStatus == '6'
                    ? true
                    : mainStatus == '2' && title == '详情'
                    ? true
                    : mainStatus == '5'
                    ? true
                    : mainStatus == '3'
                    ? true
                    : false
                ">
                <a-form-item :labelCol="{ style: { width: '170px' } }" name="approvalDocumentsIdJt">
                  <template #label>集团审批/备案批准文件</template>
                  <JnpfUploadFile
                    v-model:value="dataForm.approvalDocumentsIdJt"
                    :disabled="
                      peopleStatus == '1' && mainStatus == '2' && title != '审核'
                        ? true
                        : peopleStatus == '1' && mainStatus == '2' && title == '审核'
                        ? false
                        : mainStatus == '2' && title == '审核' && dataForm.isApproval
                        ? false
                        : mainStatus == '2' && title == '审核' && peopleStatus == '3' && !dataForm.isApproval
                        ? false
                        : mainStatus == '2' && title == '审核' && peopleStatus == '2' && dataForm.isApproval
                        ? false
                        : mainStatus == '2' && title == '审核' && peopleStatus == '2' && !dataForm.isApproval
                        ? false
                        : mainStatus == '6'
                        ? true
                        : mainStatus == '2' && title == '详情'
                        ? true
                        : mainStatus == '2' && title == '审核'
                        ? true
                        : mainStatus == '5'
                        ? true
                        : true
                    "
                    @change="changeData('approvalDocumentsIdJt', -1)"
                    :fileSize="10"
                    sizeUnit="MB"
                    :limit="9"
                    pathType="defaultPath"
                    :isAccount="0"
                    buttonText="点击上传"
                    tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）">
                  </JnpfUploadFile>
                </a-form-item>
              </a-col>
            </div>
            <a-col :span="24" class="ant-col-item" v-if="dataForm.managementStyle == 1">
              <a-button type="primary" @click="singleFileDownload(2)" style="float: right">招标采购方案审批表下载</a-button>
            </a-col>
          </div>
          <div style="display: flex; flex-wrap: wrap" v-if="activecnbnut == '2'">
            <a-col :span="24" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="resultReportedFileName">
                <template #label>结果上报文件名称</template>
                <JnpfUploadFile
                  v-model:value="dataForm.resultReportedFileName"
                  :disabled="
                    title == '归档'
                      ? true
                      : title == '审核'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('resultReportedFileName', -1)"
                  :fileSize="10"
                  sizeUnit="MB"
                  :limit="9"
                  pathType="defaultPath"
                  :isAccount="0"
                  buttonText="点击上传"
                  tipText="上报文件PDF（文件名+文号）；单文件上传大小最大10MB">
                </JnpfUploadFile>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="bidOpeningTime">
                <template #label>开标时间</template>
                <JnpfDatePicker
                  v-model:value="dataForm.bidOpeningTime"
                  :disabled="
                    title == '归档'
                      ? true
                      : title == '审核'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('bidOpeningTime', -1)"
                  placeholder="请选择"
                  :allowClear="true"
                  :style="{ width: '100%' }"
                  format="YYYY-MM-DD HH:mm:ss"
                  :startTime="getRelationDate(false, 1, 1, '', '')"
                  :endTime="getRelationDate(false, 1, 1, '', '')">
                </JnpfDatePicker>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="explanationObid">
                <template #label>开标情况说明</template>
                <JnpfTextarea
                  v-model:value="dataForm.explanationObid"
                  :disabled="
                    title == '归档'
                      ? true
                      : title == '审核'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('explanationObid', -1)"
                  placeholder="请输入"
                  :allowClear="true"
                  :style="{ width: '100%' }"
                  :autoSize="{ minRows: 2, maxRows: 4 }">
                </JnpfTextarea>
              </a-form-item>
            </a-col>
            <a-col :span="12" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="winningBidderType">
                <template #label>中标人及中标金额</template>
                <div style="display: flex">
                  <JnpfSelect
                    v-model:value="dataForm.winningBidderType"
                    :disabled="
                      title == '归档'
                        ? true
                        : title == '审核'
                        ? true
                        : mainStatus == '10'
                        ? false
                        : mainStatus == '3' && peopleStatus == '3'
                        ? true
                        : dataForm.managementStyle == 2 && title != '详情'
                        ? false
                        : title == '审核'
                        ? dataForm.isApproval
                        : resultTable
                    "
                    @change="changeBidderType"
                    placeholder="请选择"
                    :allowClear="true"
                    :style="{ width: '70%' }"
                    :showSearch="false"
                    :options="winningBidder"
                    :fieldNames="queryTypeBidde">
                  </JnpfSelect>
                  <div
                    v-if="
                      title == '归档'
                        ? false
                        : title == '审核'
                        ? false
                        : mainStatus == '10'
                        ? true
                        : dataForm.managementStyle == 2 && title != '详情'
                        ? true
                        : title == '审核'
                        ? !dataForm.isApproval
                        : !resultTable
                    ">
                    <PlusCircleOutlined
                      @click="handleAdd"
                      v-if="
                        title == '归档'
                          ? false
                          : title == '审核'
                          ? false
                          : mainStatus == '10' && dataForm.winningBidderType && dataForm.winningBidderType != '1'
                          ? true
                          : dataForm.winningBidderType && dataForm.winningBidderType != '1'
                      "
                      style="font-size: 20px; margin: 5px; color: #3e5bc2" />
                    <span
                      @click="handleAdd"
                      v-if="
                        title == '归档'
                          ? false
                          : title == '审核'
                          ? false
                          : mainStatus == '10' && dataForm.winningBidderType && dataForm.winningBidderType != '1'
                          ? true
                          : dataForm.winningBidderType && dataForm.winningBidderType != '1'
                      "
                      style="color: #3e5bc2; margin: 5px; cursor: pointer"
                      >{{ dataForm.winningBidderType == '2' ? '添加标段' : '添加中标人' }}</span
                    >
                  </div>
                  <!-- <a-button type="primary" @click="hasResult">Mock</a-button> -->
                </div>
              </a-form-item>
            </a-col>
            <!--单一中标结果时  -->
            <a-col :span="24" class="ant-col-item" v-if="dataForm.winningBidderType == '1'">
              <a-form-item :labelCol="{ style: { width: '140px' } }">
                <template #label></template>
                <a-form-item>
                  <template #label></template>
                  <div style="color: #b1b1b1">中标人</div>
                  <div style="display: flex">
                    <JnpfInput
                      :disabled="
                        title == '归档'
                          ? true
                          : mainStatus == '10'
                          ? false
                          : title == '审核'
                          ? true
                          : dataForm.managementStyle == 2 && title != '详情'
                          ? false
                          : mainStatus == '3' && peopleStatus == '3'
                          ? true
                          : title == '审核'
                          ? dataForm.isApproval
                          : resultTable
                      "
                      v-model:value="bidderList[0].people"
                      placeholder="请输入中标人"
                      :allowClear="true"
                      :style="{ width: '55%' }">
                    </JnpfInput>
                    <JnpfInputNumber
                      :disabled="
                        title == '归档'
                          ? true
                          : mainStatus == '10'
                          ? false
                          : title == '审核'
                          ? true
                          : dataForm.managementStyle == 2 && title != '详情'
                          ? false
                          : mainStatus == '3' && peopleStatus == '3'
                          ? true
                          : title == '审核'
                          ? dataForm.isApproval
                          : resultTable
                      "
                      style="margin: 0 20px"
                      v-model:value="bidderList[0].amount"
                      addonAfter="万元"
                      placeholder="请输入中标金额">
                    </JnpfInputNumber>
                  </div>
                </a-form-item>
              </a-form-item>
            </a-col>
            <!--多标段中标结果时  -->
            <a-col :span="24" class="ant-col-item" v-if="dataForm.winningBidderType == '2'">
              <a-form-item :labelCol="{ style: { width: '137px' } }">
                <template #label></template>
                <a-form-item>
                  <template #label></template>
                  <div style="display: flex; flex-wrap: wrap">
                    <div v-for="(item, index) in bidderList" :key="index">
                      <span style="display: inline-block; margin-bottom: 5px; color: #acacac">标段{{ index + 1 }}</span>
                      <span
                        v-if="
                          title == '审核'
                            ? false
                            : mainStatus == '2' && title == '审核' && peopleStatus == '1'
                            ? false
                            : mainStatus == '1' && title == '审核' && peopleStatus == '3'
                            ? false
                            : mainStatus == '2' && title == '审核' && peopleStatus == '3'
                            ? false
                            : title == '归档'
                            ? false
                            : mainStatus == '10'
                            ? true
                            : dataForm.managementStyle == 2 && title != '详情'
                            ? true
                            : title == '审核'
                            ? !dataForm.isApproval
                            : !resultTable
                        "
                        @click="hasAddPeople(index)"
                        style="margin: 5px; color: #3e5bc2; cursor: pointer"
                        >添加中标人</span
                      >
                      <div style="display: flex; width: 900px">
                        <JnpfInput
                          :disabled="
                            title == '归档'
                              ? true
                              : mainStatus == '10'
                              ? false
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? false
                              : mainStatus == '3' && peopleStatus == '3'
                              ? true
                              : title == '审核'
                              ? dataForm.isApproval
                              : resultTable
                          "
                          style="margin: 0 5px 5px 5px"
                          v-model:value="item.bidSection"
                          placeholder="标段"
                          :allowClear="true"
                          :style="{ width: '50%' }">
                        </JnpfInput>
                        <JnpfInput
                          :disabled="
                            title == '归档'
                              ? true
                              : mainStatus == '10'
                              ? false
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? false
                              : mainStatus == '3' && peopleStatus == '3'
                              ? true
                              : title == '审核'
                              ? dataForm.isApproval
                              : resultTable
                          "
                          style="margin: 0 5px 5px 5px"
                          v-model:value="item.people"
                          placeholder="中标人"
                          :allowClear="true"
                          :style="{ width: '40%' }">
                        </JnpfInput>
                        <JnpfInputNumber
                          style="margin: 0 5px 5px 5px"
                          v-model:value="item.amount"
                          :disabled="
                            title == '归档'
                              ? true
                              : mainStatus == '10'
                              ? false
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? false
                              : mainStatus == '3' && peopleStatus == '3'
                              ? true
                              : title == '审核'
                              ? dataForm.isApproval
                              : resultTable
                          "
                          placeholder="中标金额"
                          :allowClear="true"
                          addonAfter="万元"
                          :style="{ width: '20%' }">
                        </JnpfInputNumber>
                        <DeleteOutlined
                          v-if="
                            title == '审核'
                              ? false
                              : mainStatus == '2' && title == '审核' && peopleStatus == '1'
                              ? false
                              : mainStatus == '2' && title == '审核' && peopleStatus == '3'
                              ? false
                              : mainStatus == '1' && title == '审核' && peopleStatus == '3'
                              ? false
                              : title == '归档'
                              ? false
                              : mainStatus == '10'
                              ? true
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? true
                              : title == '审核'
                              ? !dataForm.isApproval
                              : !resultTable
                          "
                          @click="handleDelete(index)"
                          style="font-size: 20px; margin: 5px; color: #4b4b4b; padding-left: 7px" />
                      </div>
                      <div v-for="(info, idx) in item.children" :key="idx" style="display: flex; margin-left: 41.2%">
                        <JnpfInput
                          :disabled="
                            title == '归档'
                              ? true
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? false
                              : mainStatus == '3' && peopleStatus == '3'
                              ? true
                              : title == '审核'
                              ? dataForm.isApproval
                              : resultTable
                          "
                          style="margin: 0 5px 5px 5px"
                          v-model:value="info.people"
                          placeholder="中标人"
                          :allowClear="true"
                          :style="{ width: '55%' }">
                        </JnpfInput>
                        <JnpfInputNumber
                          style="margin: 0 5px 5px 5px"
                          v-model:value="info.amount"
                          :disabled="
                            title == '归档'
                              ? true
                              : mainStatus == '10'
                              ? false
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? false
                              : mainStatus == '3' && peopleStatus == '3'
                              ? true
                              : title == '审核'
                              ? dataForm.isApproval
                              : resultTable
                          "
                          placeholder="中标金额"
                          :allowClear="true"
                          :style="{ width: '20%' }">
                        </JnpfInputNumber>
                        <DeleteOutlined
                          v-if="
                            title == '归档'
                              ? false
                              : mainStatus == '10'
                              ? true
                              : title == '审核'
                              ? true
                              : dataForm.managementStyle == 2 && title != '详情'
                              ? true
                              : title == '审核'
                              ? !dataForm.isApproval
                              : !resultTable
                          "
                          @click="hasChildrenDelete(index, idx)"
                          style="font-size: 20px; margin: 5px; color: #4b4b4b; padding-left: 7px" />
                      </div>
                    </div>
                  </div>
                </a-form-item>
              </a-form-item>
            </a-col>
            <!--入围机制时  -->
            <a-col :span="24" class="ant-col-item" v-if="dataForm.winningBidderType == '3'">
              <a-form-item :labelCol="{ style: { width: '135px' } }">
                <template #label></template>
                <a-form-item>
                  <template #label></template>
                  <div style="display: flex; flex-wrap: wrap">
                    <div v-for="(item, index) in bidderList" :key="index" style="display: flex">
                      <span style="margin: 5px; color: #acacac">中标人{{ index + 1 }}</span>
                      <JnpfInput
                        style="margin: 0 5px 5px 5px"
                        :disabled="
                          title == '归档'
                            ? true
                            : title == '审核'
                            ? true
                            : dataForm.managementStyle == 2 && title != '详情'
                            ? false
                            : mainStatus == '3' && peopleStatus == '3'
                            ? true
                            : title == '审核'
                            ? dataForm.isApproval
                            : resultTable
                        "
                        v-model:value="item.people"
                        placeholder="请输入中标人"
                        :allowClear="true"
                        :style="{ width: '65%' }">
                      </JnpfInput>
                      <DeleteOutlined
                        v-if="
                          title == '归档'
                            ? false
                            : title == '审核'
                            ? false
                            : dataForm.managementStyle == 2 && title != '详情'
                            ? true
                            : title == '审核'
                            ? !dataForm.isApproval
                            : !resultTable
                        "
                        @click="handleDelete(index)"
                        style="font-size: 20px; margin: 5px; color: #4b4b4b" />
                    </div>
                  </div>
                </a-form-item>
              </a-form-item>
            </a-col>
            <a-col :span="16" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="bidEvaluationCommittee">
                <template #label>评标委员会设置</template>
                <JnpfInput
                  v-model:value="dataForm.bidEvaluationCommittee"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '审核'
                      ? true
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('bidEvaluationCommittee', -1)"
                  placeholder="共                  人。业主代表        人，姓名：              "
                  :allowClear="true"
                  :style="{ width: '100%' }">
                </JnpfInput>
              </a-form-item>
            </a-col>
            <a-col :span="8" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="tenderAgencyFee">
                <template #label>招标代理费</template>
                <JnpfInputNumber
                  v-model:value="dataForm.tenderAgencyFee"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '审核'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('tenderAgencyFee', -1)"
                  addonAfter="元"
                  placeholder="请输入"
                  :style="{ width: '100%' }"
                  :step="1"
                  :controls="false">
                </JnpfInputNumber>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="attachmentObiddingResultsOneId">
                <template #label>招标结果附件</template>
                <JnpfUploadFile
                  v-model:value="dataForm.attachmentObiddingResultsOneId"
                  :disabled="
                    title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '审核'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : mainStatus == '3' && peopleStatus == '3'
                      ? true
                      : title == '审核'
                      ? dataForm.isApproval
                      : resultTable
                  "
                  @change="changeData('attachmentObiddingResultsOneId', -1)"
                  :fileSize="10"
                  sizeUnit="MB"
                  :limit="9"
                  pathType="defaultPath"
                  :isAccount="0"
                  buttonText="点击上传"
                  tipText="招标结果（评标报告）及相关附件（上传PDF版）；
中标候选人投标书（上传PDF版）；单文件上传大小最大10MB">
                </JnpfUploadFile>
              </a-form-item>
            </a-col>
            <a-col :span="24" class="ant-col-item" v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingDecisionProcedure">
                <template #label>审批/备案决策程序</template>
                <JnpfCheckbox
                  v-model:value="dataForm.filingDecisionProcedure"
                  :disabled="
                    isSubNum == '1'
                      ? true
                      : title == '归档'
                      ? true
                      : mainStatus == '10'
                      ? false
                      : title == '审核'
                      ? true
                      : dataForm.managementStyle == 2 && title != '详情'
                      ? false
                      : title == '详情'
                      ? true
                      : title == '审核' && dataForm.isApproval
                      ? false
                      : isSub
                      ? true
                      : false
                  "
                  @change="changeData('filingDecisionProcedure', -1)"
                  :style="{ width: '100%' }"
                  :options="optionsObj.filingDecisionProcedureOptions"
                  :fieldNames="optionsObj.filingDecisionProcedureProps"
                  direction="horizontal">
                </JnpfCheckbox>
              </a-form-item>
            </a-col>
            <div v-if="(title != '新建' && dataForm.isApproval) || dataForm.managementStyle == 2">
              <!-- 一级的情况 mainStatus 3 已驳回 -->
              <div v-if="isSubNum == '1'">
                <a-col :span="24" class="ant-col-item" v-if="peopleStatus == '3'">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsThreeId">
                    <template #label>三级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsThreeId"
                      :disabled="mainStatus == '1' && title == '审核' ? true : mainStatus == '2' && title == '详情' ? true : true"
                      @change="changeData('filingResultsThreeId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="包含三级及以下；最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item" v-if="peopleStatus == '2' || peopleStatus == '3'">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsTwoId">
                    <template #label>二级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsTwoId"
                      :disabled="mainStatus == '5' ? true : mainStatus == '7' ? true : peopleStatus == '2' && mainStatus == '2' ? true : true"
                      @change="changeData('filingResultsTwoId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item">
                  <a-form-item
                    :labelCol="{ style: { width: '150px' } }"
                    name="filingResultsOneId"
                    v-if="mainStatus == '2' ? true : mainStatus == '3' ? true : mainStatus == '5' ? true : mainStatus == '7' ? true : false">
                    <template #label>一级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsOneId"
                      :disabled="
                        mainStatus == '3' ? true : mainStatus == '5' ? true : mainStatus == '2' && title == '详情' ? true : mainStatus == '7' ? true : false
                      "
                      @change="changeData('filingResultsOneId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
              </div>
              <!-- 二级的情况 -->
              <div v-if="isSubNum == '2'">
                <a-col :span="24" class="ant-col-item" v-if="peopleStatus == '3'">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsThreeId">
                    <template #label>三级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsThreeId"
                      :disabled="mainStatus == '1' && title == '审核' ? true : mainStatus == '2' && title == '详情' ? true : true"
                      @change="changeData('filingResultsThreeId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="包含三级及以下；最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsTwoId">
                    <template #label>二级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsTwoId"
                      :disabled="
                        mainStatus == '1' && title == '审核'
                          ? false
                          : mainStatus == '2' && title == '详情'
                          ? true
                          : mainStatus == '3' && title != '详情'
                          ? false
                          : true
                      "
                      @change="changeData('filingResultsTwoId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsOneId">
                    <template #label>一级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsOneId"
                      :disabled="mainStatus == '1' && title == '审核' ? true : mainStatus == '2' && title == '详情' ? true : true"
                      @change="changeData('filingResultsOneId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
              </div>
              <!-- 三级的情况 -->
              <div v-if="isSubNum == '3'">
                <a-col :span="24" class="ant-col-item">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsThreeId">
                    <template #label>三级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsThreeId"
                      @change="changeData('filingResultsThreeId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="包含三级及以下；最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsTwoId">
                    <template #label>二级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsTwoId"
                      @change="changeData('filingResultsTwoId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
                <a-col :span="24" class="ant-col-item">
                  <a-form-item :labelCol="{ style: { width: '150px' } }" name="filingResultsOneId">
                    <template #label>一级审批/备案结果</template>
                    <JnpfUploadFile
                      v-model:value="dataForm.filingResultsOneId"
                      @change="changeData('filingResultsOneId', -1)"
                      :fileSize="10"
                      sizeUnit="MB"
                      :limit="9"
                      pathType="defaultPath"
                      :isAccount="0"
                      buttonText="点击上传"
                      tipText="最终审批/备案单位核准文件（上传PDF版）；
最终审批决策会议纪要（上传PDF版）；单文件上传大小最大10MB">
                    </JnpfUploadFile>
                  </a-form-item>
                </a-col>
              </div>
            </div>
            <a-col :span="24" class="ant-col-item" v-if="dataForm.managementStyle == 2 || dataForm.isApproval" style="float: right; margin: 7px 0">
              <a-button type="primary" @click="singleFileDownload(1)" style="float: right">联合集团项目备案表下载</a-button>
              <a-button type="primary" v-if="dataForm.managementStyle == 1" @click="singleFileDownload(3)" style="float: right; margin: 0 7px"
                >结果核准表下载</a-button
              >
            </a-col>
          </div>
        </a-row>
      </a-form>
    </a-row>
  </BasicModal>
</template>
<script lang="ts" setup>
  import { create, update, getInfo, auditData, getLevel, archivingData, getFileInfo, getFileInBody, getPeople } from './helper/api';
  import { reactive, toRefs, nextTick, ref, unref, computed } from 'vue';
  import { downloadByUrl } from '/@/utils/file/download';
  import { BasicModal, useModal } from '/@/components/Modal';
  import { JnpfRelationForm } from '/@/components/Jnpf';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useUserStore } from '/@/store/modules/user';
  import type { FormInstance } from 'ant-design-vue';
  import { thousandsFormat, getDateTimeUnit, getTimeUnit } from '/@/utils/jnpf';
  import { getDictionaryDataSelector } from '/@/api/systemData/dictionary';
  import { getDataInterfaceRes } from '/@/api/systemData/dataInterface';
  import dayjs from 'dayjs';
  // 表单权限
  import { usePermission } from '/@/hooks/web/usePermission';

  interface State {
    dataForm: any;
    tableRows: any;
    dataRule: any;
    optionsObj: any;
    childIndex: any;
    isEdit: any;
    interfaceRes: any;
    //可选范围默认值
    ableAll: any;
    title: string;
    continueText: string;
    allList: any[];
    currIndex: number;
    isContinue: boolean;
    submitType: number;
    showContinueBtn: boolean;
    schemeTable: boolean;
    resultTable: boolean;
  }
  const isSub = ref(false); // 是否禁用子集团筛选
  const isSubNum = ref(''); // 是否禁用子集团筛选
  const mainStatus = ref(''); //判断新增状态变量
  const peopleStatus = ref(''); //判断人哪一级变量
  const formInfo = ref({}); //表单全部字段
  const emit = defineEmits(['reload']);
  const userStore = useUserStore();
  const userInfo = userStore.getUserInfo;
  const { createMessage, createConfirm } = useMessage();
  const [registerModal, { openModal, setModalProps }] = useModal();
  const formRef = ref<FormInstance>();
  const state = reactive<State>({
    dataForm: {
      archiveNumber: undefined,
      queryType: '3',
      managementStyle: 'ba',
      planSubmissionTime: undefined,
      reportingCorp: '',
      tenderingEntity: '',
      projectName: undefined,
      itemClassification: '',
      controlPrice: undefined,
      organizationalForm: '1',
      biddingMethod: 'xj',
      agencyOne: '',
      scoringMethodOne: '1',
      scoringMethodTwo: undefined,
      scoringIndicatorSettingsOne: '商务x分，技术x分，报价x分',
      evalSetting: '评标委员会由评标专家X人和采购人代表X人共X人组成',
      contractPeriod: 'X年',
      settingOwinningBidderOne: '评标委员会根据综合评分由高到低推荐中标候选人X名',
      annexProgrammeDocument: [],
      biddingDocumentId: [],
      decisionProcedure: [],
      approvalDocumentsId: [],
      approvalDocumentsIdJt: [],
      finalApprovalTime: undefined,
      resultReportingTime: undefined,
      resultReportedFileName: [],
      bidOpeningTime: undefined,
      explanationObid: undefined,
      winningBidderAndWinningAmount: '中标人：                  ，中标金额：        万元',
      bidEvaluationCommittee: '共                  人。业主代表        人，姓名：              ',
      tenderAgencyFee: undefined,
      attachmentObiddingResultsOneId: [],
      filingDecisionProcedure: [],
      filingResultsOneId: [],
      approvalTimeForResults: undefined,
    },

    tableRows: {},

    dataRule: {
      archiveNumber: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      managementStyle: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      planSubmissionTime: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      reportingCorp: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      tenderingEntity: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      projectName: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      itemClassification: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      controlPrice: [
        {
          required: true,
          message: '不能为空',
          trigger: ['blur', 'change'],
        },
      ],
      organizationalForm: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      biddingMethod: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      agencyOne: [
        {
          required: true,
          message: '请至少选择一个',
          trigger: 'change',
        },
      ],
      decisionProcedure: [
        {
          required: true,
          message: '请至少选择一个',
          trigger: 'change',
        },
      ],
      approvalDocumentsId: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      resultReportingTime: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      bidOpeningTime: [
        {
          required: true,
          message: '不能为空',
          trigger: 'change',
        },
      ],
      explanationObid: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      winningBidderAndWinningAmount: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      bidEvaluationCommittee: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      filingDecisionProcedure: [
        {
          required: true,
          message: '请至少选择一个',
          trigger: 'change',
        },
      ],
      winningBidderType: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      scoringIndicatorSettingsOne: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      evalSetting: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      contractPeriod: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      settingOwinningBidderOne: [
        {
          required: true,
          message: '不能为空',
          trigger: 'blur',
        },
      ],
      scoringMethodOne: [
        {
          required: true,
          message: '请至少选择一个',
          trigger: 'change',
        },
      ],
    },
    schemeTable: false, //方案表显示事件
    resultTable: false, //结果表显示事件
    optionsObj: {
      queryTypeOptions: [
        { fullName: '全部', id: '5' },
        { fullName: '自建', id: '1' },
        { fullName: '审批', id: '2' },
        { fullName: '已审批', id: '3' },
        { fullName: '待归档', id: '6' },
        { fullName: '已归档', id: '7' },
      ],
      queryTypeProps: { label: 'fullName', value: 'id' },
      managementStyleOptions: [],
      managementStyleProps: { label: 'fullName', value: 'enCode' },
      itemClassificationOptions: [],
      itemClassificationProps: { label: 'fullName', value: 'enCode' },
      organizationalFormOptions: [],
      organizationalFormProps: { label: 'fullName', value: 'enCode' },
      biddingMethodOptions: [],
      biddingMethodProps: { label: 'fullName', value: 'enCode' },
      agencyOneOptions: [],
      agencyOneProps: { label: 'fullName', value: 'enCode' },
      scoringMethodOneOptions: [
        { fullName: '综合评分法', id: '1' },
        { fullName: '其他', id: '2' },
      ],
      scoringMethodOneProps: { label: 'fullName', value: 'id' },
      decisionProcedureOptions: [],
      decisionProcedureProps: { label: 'fullName', value: 'enCode' },
      filingDecisionProcedureOptions: [],
      filingDecisionProcedureProps: { label: 'fullName', value: 'enCode' },
    },

    childIndex: -1,
    isEdit: false,
    interfaceRes: {
      itemClassification: [],
      winningBidderAndWinningAmount: [],
      controlPrice: [],
      decisionProcedure: [],
      planSubmissionTime: [],
      scoringMethodTwo: [],
      approvalTimeForResults: [],
      approvalDocumentsId: [],
      attachmentObiddingResultsOneId: [],
      organizationalForm: [],
      tenderingEntity: '',
      biddingMethod: [],
      resultReportedFileName: [],
      approvalDocumentsIdJt: [],
      resultReportingTime: [],
      annexProgrammeDocument: [],
      filingDecisionProcedure: [],
      archiveNumber: [],
      agencyOne: [],
      managementStyle: [],
      scoringMethodOne: [],
      explanationObid: [],
      bidEvaluationCommittee: [],
      settingOwinningBidderOne: [],
      queryType: [],
      tenderAgencyFee: [],
      scoringIndicatorSettingsOne: [],
      evalSetting: [],
      contractPeriod: [],
      biddingDocumentId: [],
      finalApprovalTime: [],
      projectName: [],
      bidOpeningTime: [],
      reportingCorp: '',
      filingResultsOneId: [],
    },
    //可选范围默认值
    ableAll: {},

    title: '',
    continueText: '',
    allList: [],
    currIndex: 0,
    isContinue: false,
    submitType: 0,
    showContinueBtn: true,
  });
  const { title, continueText, showContinueBtn, dataRule, dataForm, optionsObj, ableAll, schemeTable, resultTable } = toRefs(state);

  const getPrevDisabled = computed(() => state.currIndex === 0);
  const getNextDisabled = computed(() => state.currIndex === state.allList.length - 1);
  // 表单权限
  const { hasFormP } = usePermission();

  defineExpose({ init });
  const activecnbnut = ref('1'); //tab菜单初始值
  //中标人模块
  import { PlusCircleOutlined, DeleteOutlined } from '@ant-design/icons-vue';
  const bidderType = ref('');
  const winningBidder = ref([
    { fullName: '单一中标结果', enCode: '1' },
    { fullName: '多标题段中标结果', enCode: '2' },
    { fullName: '入围机制', enCode: '3' },
  ]);
  const queryTypeBidde = ref({ label: 'fullName', value: 'enCode' });
  // 表单填报数组
  /*
  bidSection 标段
  people 中标人
  amount 金额
  */
  interface Bidder {
    bidSection: string;
    people: string;
    amount: string;
    children: { bidSection: string; people: string; amount: string }[];
  }
  const bidderList = ref<Bidder[]>([{ bidSection: '', people: '', amount: '', children: [] }]);
  // 新增事件
  const handleAdd = () => {
    bidderList.value.push({ bidSection: '', people: '', amount: '', children: [] });
  };
  // 删除事件
  const handleDelete = index => {
    bidderList.value.splice(index, 1);
  };
  // 子删除事件
  const hasChildrenDelete = (bidderIndex, childIndex) => {
    // bidderList.value.splice(index, 1);
    bidderList.value[bidderIndex].children.splice(childIndex, 1);
  };
  // 多中标结果添加中标人
  const hasAddPeople = v => {
    bidderList.value[v].children.push({ bidSection: '', people: '', amount: '' });
  };
  // 切换类型时 重置数组
  const changeBidderType = () => {
    bidderList.value = [{ bidSection: '', people: '', amount: '', children: [] }];
  };
  // Mock
  const hasResult = () => {
    console.log('bidderList.value', bidderList.value);
  };
  // 中标人模块 END
  function init(data) {
    mainStatus.value = data.mainStatus;
    console.log('demo3-mainStatus.value', mainStatus.value);
    // 新建的时候 放出第一个表
    // 编辑的时候 根据 true false
    // 详情的时候 全放出来 全置灰
    // schemeTable: boolean;
    // resultTable: boolean;
    if (data.title == '新建') {
      state.schemeTable = false;
      state.resultTable = true;
    } else if (data.title == '详情') {
      state.showContinueBtn = false;
      state.schemeTable = true;
      state.resultTable = true;
    } else if (data.title == '编辑' && data.mainStatus == 10) {
      state.schemeTable = false;
      state.resultTable = false;
    }
    state.isContinue = false;
    state.title = data.title;
    formInfo.value = data.record;
    state.continueText = data.title == '新增' || data.title == '新建' ? '确定并新增' : '确定并继续';
    data.title == '审核' ? (state.continueText = '不通过') : '确定并继续';
    setFormProps({ continueLoading: false });
    state.dataForm.id = data.id;
    openModal();
    state.allList = data.allList;
    state.currIndex = state.allList.length && data.id ? state.allList.findIndex(item => item.id === data.id) : 0;
    nextTick(() => {
      getForm().resetFields();
      setTimeout(initData, 0);
    });
  }
  function initData() {
    changeLoading(true);
    if (state.dataForm.id) {
      getData(state.dataForm.id);
      getPeopleType(state.dataForm.id);
      //初始化options
      getmanagementStyleOptions();
      getitemClassificationOptions();
      getorganizationalFormOptions();
      getbiddingMethodOptions();
      getagencyOneOptions();
      getdecisionProcedureOptions();
      getfilingDecisionProcedureOptions();
    } else {
      //初始化options
      getmanagementStyleOptions();
      getitemClassificationOptions();
      getorganizationalFormOptions();
      getbiddingMethodOptions();
      getagencyOneOptions();
      getdecisionProcedureOptions();
      getfilingDecisionProcedureOptions();

      // 设置默认值
      state.dataForm = {
        archiveNumber: undefined,
        queryType: '2',
        managementStyle: '1',
        projectNumber: undefined,
        planSubmissionTime: dayjs().format('YYYY-MM-DD'),
        reportingCorp: '',
        tenderingEntity: '',
        projectName: undefined,
        itemClassification: '',
        organizationalForm: '1',
        biddingMethod: '',
        agencyOne: '',
        scoringMethodOne: '1',
        scoringMethodTwo: undefined,
        scoringIndicatorSettingsOne:
          '商务/价格标                  %、资信标                  %、技术标                  %（或资信、技术标                  %）',
        evalSetting: '评标委员会由评标专家X人和采购人代表X人共X人组成',
        contractPeriod: 'X年',
        settingOwinningBidderOne: '评标委员会根据综合评分由高到低推荐中标候选人X名',
        annexProgrammeDocument: [],
        biddingDocumentId: [],
        decisionProcedure: '["1","2"]',
        approvalDocumentsId: [],
        approvalDocumentsIdJt: [],
        finalApprovalTime: undefined,
        resultReportingTime: undefined,
        resultReportedFileName: [],
        bidOpeningTime: undefined,
        explanationObid: undefined,
        winningBidderAndWinningAmount: '中标人：                  ，中标金额：        万元',
        bidEvaluationCommittee: '共                  人。业主代表        人，姓名：              ',
        tenderAgencyFee: '                 元',
        attachmentObiddingResultsOneId: [],
        settingOwinningBidderTwo: undefined,
        winningBidderCandidate: '',
        filingDecisionProcedure: '["1","2"]',
        filingResultsOneId: [],
        approvalTimeForResults: undefined,
      };
      state.childIndex = -1;
      changeLoading(false);
    }
  }
  function getForm() {
    const form = unref(formRef);
    if (!form) {
      throw new Error('form is null!');
    }
    return form;
  }
  function getData(id) {
    getInfo(id).then(res => {
      bidderList.value = res.data.winningBidderInfo;
      // bidderType.value = res.data.winningBidderType;
      state.dataForm = res.data || {};
      getmanagementStyleOptions();
      getitemClassificationOptions();
      getorganizationalFormOptions();
      getbiddingMethodOptions();
      getagencyOneOptions();
      getdecisionProcedureOptions();
      getfilingDecisionProcedureOptions();

      state.childIndex = -1;
      changeLoading(false);
    });
  }
  function getLevelType() {
    getLevel().then(res => {
      isSubNum.value = res.msg;
      // 1级 集团
      // 2级 子集团
      // 3级 集团 子集团
      // 4级 集团 子集团 项目单位审批
      if (res.msg == 1) {
        isSub.value = true;
        state.optionsObj.decisionProcedureOptions
          ? (state.optionsObj.decisionProcedureOptions = state.optionsObj.decisionProcedureOptions.filter(item => item.fullName == '集团审批'))
          : [];
        state.optionsObj.filingDecisionProcedureOptions
          ? (state.optionsObj.filingDecisionProcedureOptions = state.optionsObj.filingDecisionProcedureOptions.filter(item => item.fullName == '集团审批'))
          : [];
      } else if (res.msg == 2) {
        state.optionsObj.decisionProcedureOptions
          ? (state.optionsObj.decisionProcedureOptions = state.optionsObj.decisionProcedureOptions.filter(item => item.fullName != '项目单位审批'))
          : [];
        state.optionsObj.filingDecisionProcedureOptions
          ? (state.optionsObj.filingDecisionProcedureOptions = state.optionsObj.filingDecisionProcedureOptions.filter(item => item.fullName != '项目单位审批'))
          : [];
      } else if (res.msg == 3) {
        state.optionsObj.decisionProcedureOptions
          ? (state.optionsObj.decisionProcedureOptions = state.optionsObj.decisionProcedureOptions.filter(item => item.fullName != '项目单位审批'))
          : [];
        state.optionsObj.filingDecisionProcedureOptions
          ? (state.optionsObj.filingDecisionProcedureOptions = state.optionsObj.filingDecisionProcedureOptions.filter(item => item.fullName != '项目单位审批'))
          : [];
      }
    });
  }
  function getPeopleType(v) {
    getPeople(v).then(res => {
      peopleStatus.value = res.msg;
      console.log('peopleStatus.value', peopleStatus.value);
    });
  }
  // 审核
  function submitDataForm(id, act) {
    auditData({ id: id, act: act, remake: '' }).then(res => {
      createMessage.success(res.msg);
      initData();
      emit('reload');
      setFormProps({ visible: false });
    });
  }
  // 归档
  function archivingDataForm(id) {
    archivingData({ id: id }).then(res => {
      createMessage.success(res.msg);
      initData();
      emit('reload');
      setFormProps({ visible: false });
    });
  }
  // 单文件下载
  function singleFileDownload(type) {
    //1-备案表 2-审批 3-结果
    state.dataForm.winningBidderInfo = bidderList.value;
    getFileInBody(state.dataForm.id, type, state.dataForm).then(res => {
      if (res.code == 200) {
        downloadByUrl({ url: res.data.url, fileName: res.data.name });
      } else {
        createMessage.error(res.msg);
      }
    });
  }
  // 暂存
  function temporaryStorage() {
    const formMethod = create;
    //中标人模块
    state.dataForm.winningBidderInfo = bidderList.value;
    state.dataForm.saveType = 2; // 保存类型 1:保存 2:暂存
    formMethod(state.dataForm)
      .then(res => {
        createMessage.success(res.msg);
        state.submitType === 1 ? setFormProps({ continueLoading: false }) : setFormProps({ confirmLoading: false });
        if (state.submitType == 1) {
          initData();
          state.isContinue = true;
        } else {
          setFormProps({ visible: false });
          emit('reload');
        }
      })
      .catch(() => {});
  }
  async function handleSubmit(type) {
    if (state.title == '详情') return createMessage.error('详情状态下不能新增操作！');
    // 中标人及中标金额表单提交校验
    if (state.dataForm.winningBidderType == 1) {
      if (bidderList.value[0].people == '') return createMessage.error('请输入中标人');
      if (bidderList.value[0].amount == '') return createMessage.error('请输入中标金额');
    } else if (state.dataForm.winningBidderType == 2) {
      const result = bidderList.value.filter(item => item.people == '');
      if (result.length > 0) return createMessage.error('请输入中标人');
      const amountResult = bidderList.value.filter(item => item.amount == '');
      if (amountResult.length > 0) return createMessage.error('请输入中标金额');
      const bidSectionResult = bidderList.value.filter(item => item.bidSection == '');
      if (bidSectionResult.length > 0) return createMessage.error('请输入标段');
    } else if (state.dataForm.winningBidderType == 3) {
      const result = bidderList.value.filter(item => item.people == '');
      if (result.length > 0) return createMessage.error('请输入中标人');
    }
    try {
      const values = await getForm()?.validate();
      if (!values) return;
      if (state.dataForm.managementStyle == 2) {
        if (!state.dataForm.bidOpeningTime || !state.dataForm.explanationObid || !state.dataForm.winningBidderType) {
          return createMessage.error('请填写招标结果内容！');
        }
      }
      state.submitType = type;
      state.submitType === 1 ? setFormProps({ continueLoading: true }) : setFormProps({ confirmLoading: true });
      const formMethod = state.dataForm.id && mainStatus.value != '10' ? update : create;
      //中标人模块
      state.dataForm.winningBidderInfo = bidderList.value;
      state.dataForm.saveType = 1; // 保存类型 1:保存 2:暂存
      formMethod(state.dataForm)
        .then(res => {
          console.log('res', res);
          if (state.title == '审核' && type == 1) {
            submitDataForm(state.dataForm.id, '2');
          } else if (state.title == '审核' && type == 0) {
            submitDataForm(state.dataForm.id, '1');
          } else if (state.title == '归档') {
            archivingDataForm(state.dataForm.id);
          }
          state.submitType === 1 ? setFormProps({ continueLoading: false }) : setFormProps({ confirmLoading: false });
          if (state.submitType == 1) {
            initData();
            state.isContinue = true;
          } else {
            setFormProps({ visible: false });
            emit('reload');
          }
        })
        .catch(() => {
          state.submitType === 1 ? setFormProps({ continueLoading: false }) : setFormProps({ confirmLoading: false });
        });
    } catch (_) {}
  }
  function handlePrev() {
    state.currIndex--;
    handleGetNewInfo();
  }
  function handleNext() {
    state.currIndex++;
    handleGetNewInfo();
  }
  function handleGetNewInfo() {
    changeLoading(true);
    getForm().resetFields();
    const id = state.allList[state.currIndex].id;
    getData(id);
  }
  function setFormProps(data) {
    setModalProps(data);
  }
  function changeLoading(loading) {
    setModalProps({ loading });
  }
  async function onClose() {
    if (state.isContinue) emit('reload');
    return true;
  }

  function changeData(model, index) {
    state.isEdit = false;
    state.childIndex = index;
    for (let key in state.interfaceRes) {
      if (key != model) {
        let faceReList = state.interfaceRes[key];
        for (let i = 0; i < faceReList.length; i++) {
          let relationField = faceReList[i].relationField;
          if (relationField) {
            let modelAll = relationField.split('-');
            let faceMode = '';
            for (let i = 0; i < modelAll.length; i++) {
              faceMode += modelAll[i];
            }
            if (faceMode == model) {
              let options = 'get' + key + 'Options';
              eval(options)(true);
              changeData(key, index);
            }
          }
        }
      }
    }
  }
  function changeDataFormData(type, data, model, index, defaultValue) {
    if (!state.isEdit) {
      if (type == 2) {
        for (let i = 0; i < state.dataForm[data].length; i++) {
          if (index == -1) {
            state.dataForm[data][i][model] = defaultValue;
          } else if (index == i) {
            state.dataForm[data][i][model] = defaultValue;
          }
        }
      } else {
        state.dataForm[data] = defaultValue;
      }
    }
  }
  //数据选项--数据字典初始化方法
  function getmanagementStyleOptions() {
    getDictionaryDataSelector('539396086083622085').then(res => {
      state.optionsObj.managementStyleOptions = res.data.list;
    });
  }
  //数据选项--数据字典初始化方法
  function getitemClassificationOptions() {
    getDictionaryDataSelector('539390743437907141').then(res => {
      state.optionsObj.itemClassificationOptions = res.data.list;
    });
  }
  //数据选项--数据字典初始化方法
  function getorganizationalFormOptions() {
    getDictionaryDataSelector('539393647729185989').then(res => {
      state.optionsObj.organizationalFormOptions = res.data.list;
    });
  }
  //数据选项--数据字典初始化方法
  function getbiddingMethodOptions() {
    getDictionaryDataSelector('539394095383057605').then(res => {
      state.optionsObj.biddingMethodOptions = res.data.list;
    });
  }
  //数据选项--数据字典初始化方法
  function getagencyOneOptions() {
    getDictionaryDataSelector('dc6b2542d94b5434fc61ec1d59592901').then(res => {
      state.optionsObj.agencyOneOptions = res.data.list;
    });
  }
  //数据选项--数据字典初始化方法
  function getdecisionProcedureOptions() {
    getDictionaryDataSelector('539394681591567557').then(res => {
      state.optionsObj.decisionProcedureOptions = res.data.list;
      getLevelType();
    });
  }
  //数据选项--数据字典初始化方法
  function getfilingDecisionProcedureOptions() {
    getDictionaryDataSelector('539394681591567557').then(res => {
      state.optionsObj.filingDecisionProcedureOptions = res.data.list;
      getLevelType();
    });
  }
  function getRelationDate(timeRule, timeType, timeTarget, timeValueData, dataValue) {
    let timeDataValue: any = null;
    let timeValue = Number(timeValueData);
    if (timeRule) {
      if (timeType == 1) {
        timeDataValue = timeValue;
      } else if (timeType == 2) {
        timeDataValue = dataValue;
      } else if (timeType == 3) {
        timeDataValue = new Date().getTime();
      } else if (timeType == 4 || timeType == 5) {
        const type = getTimeUnit(timeTarget);
        const method = timeType == 4 ? 'subtract' : 'add';
        timeDataValue = dayjs()[method](timeValue, type).valueOf();
      }
    }
    return timeDataValue;
  }
  function getRelationTime(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
    let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType;
    let timeDataValue: any = null;
    if (timeRule) {
      if (timeType == 1) {
        timeDataValue = timeValue || '00:00:00';
        if (timeDataValue.split(':').length == 3) {
          timeDataValue = timeDataValue;
        } else {
          timeDataValue = timeDataValue + ':00';
        }
      } else if (timeType == 2) {
        timeDataValue = dataValue;
      } else if (timeType == 3) {
        timeDataValue = dayjs().format(format);
      } else if (timeType == 4 || timeType == 5) {
        const type = getTimeUnit(timeTarget + 3);
        const method = timeType == 4 ? 'subtract' : 'add';
        timeDataValue = dayjs()[method](timeValue, type).format(format);
      }
    }
    return timeDataValue;
  }
</script>
<style>
  .ant-modal .ant-modal-body > .scrollbar {
    padding: 0px 30px 0 !important;
  }
  .tips {
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 5px;
    font-size: 12px;
    word-break: break-all;
  }
</style>
